package cn.bjit.mapper;

import cn.bjit.model.ProductDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yx
 * @since 2022-06-20
 */
public interface ProductMapper extends BaseMapper<ProductDO> {
//    锁定商品记录
    int lockProductStock(@Param("productId")long productId, @Param("buyNum") int buyNum);
    //恢复库存，就是锁定库存的值-购买的值
    void unLockProductStock(@Param("productId") Long productId, @Param("buyNum") Integer buyNum);
}
